//
//  YTLoginTests.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/5/10.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import <XCTest/XCTest.h>
#import "YTLoginViewModel.h"
#import "YTRegisterViewModel.h"
#import "YTUtilityManager.h"

@interface YTLoginTests : XCTestCase
@property (strong, nonatomic) YTLoginViewModel *loginViewModel;
@property (strong, nonatomic) YTRegisterViewModel *registerViewModel;
@end

@implementation YTLoginTests

- (void)setUp {
    [super setUp];
    _loginViewModel = [[YTLoginViewModel alloc] init];
    _registerViewModel = [[YTRegisterViewModel alloc] init];
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testLogin {
    _loginViewModel.phoneNum = @"15258858155";
    _loginViewModel.password = @"zxb1314";
    _loginViewModel.areaCode = @"86";
    [_loginViewModel setValue:@(YES) forKey:@"isChecked"];
    
    XCTAssertEqual(_loginViewModel.phoneVerify.first, @(YES));
    XCTAssertEqual(_loginViewModel.passwordVerify.first, @(YES));
    XCTAssertEqual(_loginViewModel.verifyAll.first, @(YES));
    
    [_loginViewModel.loginCommand execute:nil];
    XCTAssertNotNil([[YTUtilityManager manager] getUserID]);
}

- (void)testRegister {
    
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
